<template>
	<view class="page-body ">
		<view class="u-page">
			<scroll-view class="goods-list" scroll-y @scrolltolower="loadData('add')">
				<view class="goods-list-row">
					<!-- 列表 -->
					<u-swipe-action :index="index" v-for="(item, index) in itemList.list" :key="item.id":options="options">
						<view class="goods-item smll"  @click="app.goPage('/pagesVideo/pages/tuan/detail?vid=' + item.id + '&mid=' + item.smid)">
							<!-- 警告：微信小程序不支持嵌入lazyload组件，请自行如下使用image标签 -->
							<view class="image-wrapper " >
								<image :src="item.image" mode="aspectFill"></image>
							</view>
							<view class="info-wrapper flex_bd">
								<view class="title " style="font-weight: 600;">{{item.gather_title}}</view>
								<view class="title " >剧集类型:{{item.title}}</view>
								<view class="price-box smll">
									<text class="price flex_bd">价格：{{item.price}}</text>
								</view>
							</view>
						</view>
					</u-swipe-action>
				</view>
				<!-- 空白页 -->
				<empty v-if="itemList.list.length === 0"></empty>
				<view v-if="itemList.list.length > 0" style="height: 60rpx;"></view>
			</scroll-view>
		
		</view>
	</view>
</template>

<script>
	import empty from "@/components/empty";
	import request from '@/utils/request.js'
	export default {
		components: {
			empty
		},
		data() {
			let that = this;
			return {
				// baseUrl: this.config.cdnUrl,
				getCartNum:0,//1执行请求购物车数量
				keyword: '',
				loadingType: 'more', //加载更多状态
				filterIndex: 0,
				itemList: {
					list: []
				}, //商品列表
				empty: false, //商品列表为空
				options: [{
					text: '取消',
					style: {
						backgroundColor: '#F65236'
					}
				}]
				
			}
		},
		onLoad(options) {
			this.loadData();
		},
		onShow(){
		},
		onHide(){
		},
		onReady() {},
		methods: {
			jinru(){
				
			},
			//加载商品 
			async loadData() {
				request.post('/video/recordlists',).then(res => {
					// this.itemList.list = res
					this.itemList.list = this.itemList.list.concat(res);
					// //loaded新字段用于表示数据加载完毕，如果为空可以显示空白页
					// this.$set(this.itemList, 'loaded', true);
				})
			},
			stopPrevent() {}
		}
	}
</script>

<style lang="scss">
	.smll {
	    display: -webkit-box;
	    display: -webkit-flex;
	    display: flex;
	    -webkit-box-align: center;
	    -webkit-align-items: center;
	    align-items: center;
	}
	.page-body{
		height: 100%;
	}
	.u-page {
			//height: calc(100% - 90rpx);
			height: 100%;
			overflow: hidden;
		}
		
		.goods-list {
			position: relative;
			height: calc(100% - 178rpx);
		}
	
		/* 商品列表 行*/
		.goods-list-row {
			z-index: 2;
			.goods-item {
				width: 100%;
				margin-bottom: 20rpx;
				padding: 20rpx;
				background-color: #FFFFFF;
			}
			.image-wrapper {
				width: 200rpx;
				height: 200rpx;
				border-radius: 3px;
				overflow: hidden;
	
				image {
					width: 100%;
					height: 100%;
					opacity: 1;
				}
			}
			.info-wrapper {
				display: flex;
				flex-direction: column;
				flex: 1;
				overflow: hidden;
				position: relative;
				padding-left: 15px;
				.title {
					font-size: 32rpx;
					color: #303133;
					line-height: 60rpx;
					overflow: hidden;
				}
				.short_name {
					display: none;
				}
				.price-box {
					align-items: center;
					justify-content: space-between;
					padding-right: 10rpx;
					font-size: 24rpx;
					color: #909399;
				}
				.price {
					font-size: 32rpx;
					color: #fc4a5b;
					line-height: 1;
	
				}
				.u-icon {
					color: #fc4a5b;
				}
			}
		}
</style>
